<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			//基本用法
			let[x,y] = [1,2];
			console.log(x,y);//1,2
			//剩余运算符
			let a,b,rest;
			[a,b,...rest] = [1,2,3,4,5,6];
			console.log(a,b,rest);//rest[3,4,5,6];
			//可忽略
			let[a,,b] = [1,2,3];
			console.log(a,b);
			//不完全解构
			let[a,b] = [1];
			console.log(a,b);
			//解构默认值
			let[a,b=2] = [1];
			console.log(a,b);
			//对字符串进行解构赋值
			let[a,b,c,d,e] = "hello";
			console.log(a,b,c,d,e);
		</script>
	</body>
</html>
